#ifndef _SMART_DEVICE_DATABASE_HEAD_H
#define _SMART_DEVICE_DATABASE_HEAD_H
#include <sqlite3.h>
#include <stdio.h>
#include <strings.h>
#include <string> // Include the correct header for std::string
#include <cstring>
#include <vector>

using namespace std;

typedef struct
{
    string operation;
    string deviceType;
    string deviceNumber;

} smart_device_t;

class SmartDeviceDatabase
{
public:
    static SmartDeviceDatabase *getSmartDeviceDatabase();
    bool addDevice(const string &operation, const string &deviceType, const string &deviceNumber);
    bool removeDevice(const string &operation, const string &deviceType, const string &deviceNumber);
    vector<smart_device_t> queryDevice(bool *ok = nullptr);

private:
    SmartDeviceDatabase();
    ~SmartDeviceDatabase();
    static SmartDeviceDatabase *db;
    sqlite3_stmt *add_stmt;
    sqlite3_stmt *remove_stmt;
    sqlite3_stmt *query_stmt;
    sqlite3 *pdb;
};

#endif